package br.mikhas.util.date;

/**
 * An instant represents a point of time.
 * <p>
 * The instant precision is defined by the fields it can hold.
 * <p>
 * The most precise field is <code>MILLISECOND</code> and the least is
 * <code>YEAR</code>.
 * 
 * @author Mikhail Domanoski
 * 
 */
public interface Instant {

	/**
	 * Year field
	 */
	public static final int YEAR = 0;

	/**
	 * The month of the year
	 */
	public static final int MONTH = 1;

	/**
	 * The day of the month
	 */
	public static final int DAY = 2;

	/**
	 * The hour of the day
	 */
	public static final int HOUR = 3;

	/**
	 * The minute of the hour
	 */
	public static final int MINUTE = 4;

	/**
	 * The second of the minute
	 */
	public static final int SECOND = 5;

	/**
	 * The millisecond of the second
	 */
	public static final int MILLISECOND = 6;

	/**
	 * Checks if this instant hold the given field.
	 * 
	 * @param field
	 *            The number of the field
	 * @return <code>true</code> if the instant contains the field
	 */
	public boolean containsField(int field);

	/**
	 * Gets the value of the numbered field.
	 * 
	 * @param field
	 *            The number of the field
	 * @return The value of the field
	 */
	public int getField(int field);

	/**
	 * Counts how may fields the instant can hold
	 * 
	 * @return The number of field this instant can hold
	 */
	public int fieldCount();
}
